//
//  UIView+Frame.m
//  woaoappios
//
//  Created by jianghui yin on 14-10-8.
//  Copyright (c) 2014年 16816. All rights reserved.
//

#import "UIView+LBFrame.h"

@implementation UIView (LBFrame)

- (CGFloat)lb_top
{
    return self.frame.origin.y;
}

-(void)setLb_top:(CGFloat)y
{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}

- (CGFloat)lb_right
{
    return self.frame.origin.x + self.frame.size.width;
}

- (void)setLb_right:(CGFloat)right
{
    CGRect frame = self.frame;
    frame.origin.x = right - self.frame.size.width;
    self.frame = frame;
}

- (CGFloat)lb_bottom
{
    return self.frame.origin.y + self.frame.size.height;
}

- (void)setLb_bottom:(CGFloat)bottom
{
    CGRect frame = self.frame;
    frame.origin.y = bottom - self.frame.size.height;
    self.frame = frame;
}

- (CGFloat)lb_left
{
    return self.frame.origin.x;
}

- (void)setLb_left:(CGFloat)x
{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

- (CGFloat)lb_width
{
    return self.frame.size.width;
}

- (void)setLb_width:(CGFloat)width
{
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}
-(void)setLb_centerX:(CGFloat)centerX
{
    CGPoint  center=self.center;
    center.x=centerX;
    self.center=center;

}
-(CGFloat)lb_centerX
{
    return self.center.x;
}
-(void)setLb_centerY:(CGFloat)centerY{
    
    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;
    
}
-(CGFloat)lb_centerY
{
    return self.center.y;
}

- (CGFloat)lb_height
{
    return self.frame.size.height;
}

- (void)setLb_height:(CGFloat)height
{
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}

@end
